package com.xiaoyang.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author lichenyang
 * @create 2021-07-14 08:19
 *
 * 用来测试拦截器
 */
@Slf4j
@RestController
public class LoginController {

    @RequestMapping("/login")
    public String login(HttpSession session){
        log.info("当前方法是:{}", "login");
        session.setAttribute("loginUser", "test");
        return "登录成功";
    }

    @RequestMapping("/hello")
    public String hello(){
        log.info("开始执行 hello 方法");
        return "hello";
    }

}
